/*
 * TerrainType.java
 */

package terrain;

/**
 * an Enumeration of terrain types. 
 * 
 * @author Travis Drake
 * 
 * @version Oct 3, 2012
 */
public enum TerrainType
{
    DIRT, LOOSE_DIRT, HARD_DIRT, WET_DIRT, CLAY, SAND, STONE, PUDDLE, RIVER, DEEP_WATER, STILL_WATER, WOOD, TREE, ROOT, CONCRETE, ASPHALT, HOUSING, TUNNEL, ANT_HILL;

    
    
    /**
     * Method to see if a terrain type is flyable.
     * Checks the non-flyable terrains because the list is shorter.
     * 
     * @param the_type the terrain type.
     * 
     * @return whether or not this terrain type is flyable.
     */
    public static boolean isFlyable(TerrainType the_type)
    {
        boolean to_return = true;
        // BAD PRACTICE TO HAVE MULTIPLE RETURN STATEMENTS IN A METHOD, SO WE USUALLY STORE WHAT TO RETURN
        // IN A TEMP VARIABLE THAT WE CREATE AT THE START OF THE METHOD, AND JUST CHANGE IT'S VALUE IN 
        // THE IF STATEMENTS. ALTERNATELY WE CAN RETURN IN THE IF STATEMENTS, I'LL WRITE THAT TOO
        // AND COMMENT THEM OUT.
        
        
        // INSIDE THIS IF WE USE "OR" LOGIC TO DEFINE ALL THE TERRAINS WE SAY ARE NOT FLYABLE.
        if (the_type == TREE || the_type == HOUSING)
        {
            to_return = false;
            // ALTERNATELY, IF NOT USING TEMP VAR:
            // return false;
        } else {
            // return true;
        }
        return to_return;
        
    }
    
}

